package com.appspot.zarm.gomoku.transfer;

import com.appspot.zarm.gomoku.Coord;
import com.google.gson.Gson;

public class JsonTransfer {

	public static Coord getCoordFromJson(String data) {
		 return (CoordImpl)new Gson().fromJson(data, CoordImpl.class);
	}

	public static String getBoardToJson(BoardExternalizer boardExternalizer, String message) {
		return new Gson().toJson(boardExternalizer.getBoardState(message));
	}
	
	public static String getGamesListToJson(GamesListExternalizer gamesListExternalizer) {
		return new Gson().toJson(gamesListExternalizer.getGamesList());
	}
}
